"""
Definition of models.
"""

from django.db import models

# Create your models here.
class Message(models.Model):
    username=models.CharField(max_length=256)
    title=models.CharField(max_length=256)
    contents=models.TextField()
    publish_date=models.DateTimeField()

class Vacation(models.Model):
    vac_date=models.CharField(max_length=50)
    vac_person=models.CharField(max_length=50)
    vac_interval=models.FloatField()
    vac_type=models.CharField(max_length=50,blank=True,null=True)
    vac_reason=models.TextField()
    vac_enddate=models.CharField(max_length=50)
    vac_week=models.CharField(max_length=50)
    vac_approver=models.CharField(max_length=50)
    vac_approvedate=models.DateTimeField(max_length=50)
    vac_approvestatus=models.IntegerField()
    vac_adddate=models.DateTimeField()
    vac_temp=models.CharField(max_length=256)
    vac_remark=models.CharField(max_length=256)

class User(models.Model):
    username=models.CharField(max_length=50)
    useremail=models.CharField(max_length=50)
    usertype=models.IntegerField()
    userdepartment=models.CharField(max_length=50)
    userpwd=models.CharField(max_length=150)
    userresume=models.CharField(max_length=50)
    regdate=models.CharField(max_length=50)
    entrydate=models.CharField(max_length=50)
    temp=models.CharField(max_length=256)
    remark=models.CharField(max_length=256)

class Expense(models.Model):
    title=models.CharField(max_length=100)
    applyuser=models.CharField(max_length=50)
    applydate=models.CharField(max_length=50)
    happenoffice=models.CharField(max_length=50)
    approvalstatus=models.IntegerField()
    approvaluser=models.CharField(max_length=50)
    approvaldate=models.CharField(max_length=50)
    totalprice=models.FloatField()
    guid=models.CharField(max_length=100)
    temp=models.CharField(max_length=256)
    remark=models.CharField(max_length=256)

class ExpenseItem(models.Model):
    itmetitle=models.CharField(max_length=100)
    expensetype=models.CharField(max_length=50)
    expenseprice=models.FloatField()
    expenseguid=models.CharField(max_length=100)
    temp=models.CharField(max_length=256)
    remark=models.CharField(max_length=256)

class Constant(models.Model):
    con_typename=models.CharField(max_length=50)
    con_typevalue=models.CharField(max_length=256)
    con_remark=models.CharField(max_length=256)

def __str__(self):
    return '{},{},{},{}'.format(self.username,self.title,self.content,self.publish_date)


